<?php

/**
 *  sendMail 发送邮件
 * @param  string $address  收件地址
 * @param  string $subject  摘要]
 * @param  string $body     邮件正文
 * @return bool             true or false
 */
public static function sendMail($address,$subject = "",$body = ""){
    $mail          = new JPhpMailer;
    $mail->IsSMTP();
    $mail->Host = 'host';
    $mail->Post = 'post';
    $mail->SMTPSecure  = "SSL";
    $mail->SMTPAuth = true;
    $mail->Username   = "email";  // SMTP服务器用户名
    $mail->Password   = "email password";            // SMTP服务器密码
    $mail->SetFrom('yourname@126.com', 'yourname');
    $mail->Subject = $subject;
    $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
    $mail->MsgHTML($body);
    $mail->AddAddress($address, $address);
    return $mail->Send();
}